<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>


<html>
<f:view>
<head>
<title>Data Iteration Example</title>
</head>
<body>
<center>
<h:outputText escape="false" value="<u><h1>JAVA LEARNING CENTER</h1></u>"
style="color:red">
</h:outputText>

<a4j:form id="listForm" rendered="#{studentListBean.flag}">
<a4j:commandButton value="get Student Details"
action="#{studentListBean.getStudents}"
reRender="listForm,slist">
</a4j:commandButton>
</a4j:form>

<h:outputText escape="false" value="<u><b>Student Details</b></u>"
 rendered="#{!studentListBean.flag}">
 </h:outputText>
 
 <rich:dataTable width="483" id="slist" rows="10"
 value="#{studentListBean.studentList}" var="student" 
 rendered="#{!studentListBean.flag}">
 
 <f:facet name="header">
 <rich:columnGroup>
 <h:column><h:outputText value="Name"/></h:column>
 <h:column><h:outputText value="Batch"/></h:column>
 <h:column><h:outputText value="Branch"/></h:column>
 <h:column><h:outputText value="Email"/></h:column>
 <h:column><h:outputText value="Phone"/></h:column>
 </rich:columnGroup>
 </f:facet>
 <h:column>
 <h:outputText value="#{student.name}"/>
 </h:column>
 
 <h:column>
 <h:outputText value="#{student.batchId}"/>
 </h:column>
 
 <h:column>
 <h:outputText value="#{student.branch}"/>
 </h:column>
 
 <h:column>
 <h:outputText value="#{student.email}"/>
 </h:column>
 
 
 <h:column>
 <h:outputText value="#{student.phone}"/>
 </h:column>
 
 </rich:dataTable>


</center>
</body>
</f:view>
</html>